﻿using System.Web.Mvc;

namespace HashFoo.Rest.Server
{
    /// <summary>
    /// Defaines a service handler for a request type.
    /// </summary>
    /// <typeparam name="TRequest">The type of the request</typeparam>
    /// <remarks>
    /// Inherits <see cref="IController"/>, as all <see cref="IServiceHandler{TRequest}"/>s must fit into the 
    /// ASP.NET MVC framework.  Implementations can use any base controller, then just include this interface as well.
    /// </remarks>
    public interface IServiceHandler<in TRequest> : IController
    {
        /// <summary>
        /// Handles the service request.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResourceActionResult Handle(TRequest request);
    }
}